bitkeeper revision 1.1212 (42136b4bPyYaGldMQjQcAZc9eqgGww)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 16 Feb 2005 15:48:27 +0000 (15:48 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 16 Feb 2005 15:48:27 +0000 (15:48 +0000)
Clean up serial-line code. Pull out arch-dep to asm header file.
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
.rootkeys
xen/arch/ia64/xenmisc.c
xen/arch/ia64/xensetup.c
xen/drivers/char/serial.c
xen/include/asm-ia64/config.h
xen/include/asm-ia64/xenserial.h
xen/include/asm-x86/serial.h [new file with mode: 0644]
xen/include/xen/serial.h

index fe46452b336d5486e1ce5544b698e14753abac2a..37ed52e46b7a4cfcaa0591271c7b9da3e3872766 100644 (file)
--- a/.rootkeys
+++ b/.rootkeys
 3ddb79c2QF5-pZGzuX4QukPCDAl59A xen/include/asm-x86/processor.h
 40cf1596bim9F9DNdV75klgRSZ6Y2A xen/include/asm-x86/regs.h
 3ddb79c2plf7ciNgoNjU-RsbUzawsw xen/include/asm-x86/rwlock.h
+42136b49h6MkeayfuOaTPcJQWKga2g xen/include/asm-x86/serial.h
 405b8599BsDsDwKEJLS0XipaiQW3TA xen/include/asm-x86/shadow.h
 3ddb79c3Hgbb2g8CyWLMCK-6_ZVQSQ xen/include/asm-x86/smp.h
 3ddb79c3jn8ALV_S9W5aeTYUQRKBpg xen/include/asm-x86/smpboot.h
index c3d7d6716a1d99d588badf3236f512922fb8c8a4..663319de3c335bf09f808174b137aa3026afc123 100644 (file)
@@ -203,27 +203,6 @@ void dump_pageframe_info(struct domain *d)
        printk("dump_pageframe_info not implemented\n");
 }
 
-///////////////////////////////
-// from drivers/char/serial.c
-///////////////////////////////
-
-#include <asm/hpsim_ssc.h>
-
-int
-ia64_serial_putc(unsigned char c)
-{
-       if (platform_is_hp_ski()) {
-               ia64_ssc(c, 0, 0, 0, SSC_PUTCHAR);
-       }
-       else {
-// this is tested on HP Longs Peak platform... it
-// will probably work on other Itanium platforms as
-// well, but undoubtedly needs work
-               longs_peak_putc(c);
-       }
-       return 1;
-}
-
 ///////////////////////////////
 // from common/physdev.c
 ///////////////////////////////
index e778b897d9da3c5b20972a7050079db3492f51be..5515b3bf340d35cad47bf84afbcaf126378c5a42 100644 (file)
@@ -142,23 +142,12 @@ void cmain(multiboot_info_t *mbi)
     /* Must do this early -- e.g., spinlocks rely on get_current(). */
     set_current(&idle0_exec_domain);
 
+    early_setup_arch();
+
     /* We initialise the serial devices very early so we can get debugging. */
     serial_init_stage1();
 
-    init_console();
-#if 0
-    /* HELLO WORLD --- start-of-day banner text. */
-    printk(XEN_BANNER);
-    printk(" http://www.cl.cam.ac.uk/netos/xen\n");
-    printk(" University of Cambridge Computer Laboratory\n\n");
-    printk(" Xen version %d.%d%s (%s@%s) (%s) %s\n",
-           XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION,
-           XEN_COMPILE_BY, XEN_COMPILE_DOMAIN,
-           XEN_COMPILER, XEN_COMPILE_DATE);
-#endif
-#ifndef IA64
-    printk(" Latest ChangeSet: %s\n\n", XEN_CHANGESET);
-#endif
+    init_console(); 
     set_printk_prefix("(XEN) ");
 
 #ifdef IA64
index 29cfb61fd8c7a42fb961760e13608901e44a47ac..cc6e45a97088499a72ecb3938a73971242ddccc4 100644 (file)
@@ -6,7 +6,7 @@
  * it permits debugging of seriously-toasted machines (e.g., in situations
  * where a device driver within a guest OS would be inaccessible).
  * 
- * Copyright (c) 2003-2004, K A Fraser
+ * Copyright (c) 2003-2005, K A Fraser
  */
 
 #include <xen/config.h>
 #include <xen/serial.h>
 #include <asm/io.h>
 
-/* opt_com[12]: Config serial port with a string <baud>,DPS,<io-base>,<irq>. */
-static unsigned char opt_com1[30] = "", opt_com2[30] = "";
-string_param("com1", opt_com1);
-string_param("com2", opt_com2);
-
 /* Register offsets */
 #define RBR             0x00    /* receive buffer       */
 #define THR             0x00    /* transmit holding     */
@@ -100,15 +95,13 @@ static uart_t com[2] = {
 #define UART_ENABLED(_u) ((_u)->baud != 0)
 #define DISABLE_UART(_u) ((_u)->baud = 0)
 
-#ifdef CONFIG_X86
-static inline int arch_serial_putc(uart_t *uart, unsigned char c)
-{
-    int space;
-    if ( (space = (inb(uart->io_base + LSR) & LSR_THRE)) )
-        outb(c, uart->io_base + THR);
-    return space;
-}
-#endif
+/* Architecture-specific private definitions. */
+#include <asm/serial.h>
+
+/* opt_com[12]: Config serial port with a string <baud>,DPS,<io-base>,<irq>. */
+static unsigned char opt_com1[30] = OPT_COM1_STR, opt_com2[30] = OPT_COM2_STR;
+string_param("com1", opt_com1);
+string_param("com2", opt_com2);
 
 
 /***********************
index ac0721d89f71f1ebbd86042ed2bf9378d534f654..80a80c0eb06c978c27ee7a2cca0822d06ea4355c 100644 (file)
@@ -2,6 +2,7 @@
 // manufactured from component pieces
 
 // defined in linux/arch/ia64/defconfig
+//#define      CONFIG_IA64_GENERIC
 #define        CONFIG_IA64_HP_SIM
 #define        CONFIG_IA64_L1_CACHE_SHIFT 7
 // needed by include/asm-ia64/page.h
@@ -184,8 +185,6 @@ struct pci_bus_region {
     (likely(sizeof(count) <= 4) /* disallow 64-bit counts */ &&  \
      access_ok(type,addr,count*size))
 
-// see drivers/char/serial.c
-#define arch_serial_putc(uart,c)       ia64_serial_putc(c)
 // without this, uart_config_stageX does outb's which are non-portable
 #define NO_UART_CONFIG_OK
 
@@ -203,10 +202,6 @@ struct pci_bus_region {
 // x86 typedef still used in sched.h, may go away later
 //typedef unsigned long l1_pgentry_t;
 
-// removed from include/xen/types.h (why?)
-typedef unsigned long uint64_t;
-typedef unsigned int uint32_t;
-
 // see include/asm-ia64/mm.h, handle remaining pfn_info uses until gone
 #define pfn_info page
 
index 0b4ea621e2d08ca6e05facc8a7f67e53253fc034..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,17 +0,0 @@
-// this file is now obsolete and can be removed
-#include <asm/hpsim_ssc.h>
-
-static inline int arch_serial_putc(unsigned char c)
-{
-       if (platform_is_hp_ski()) {
-               ia64_ssc(c, 0, 0, 0, SSC_PUTCHAR);
-       }
-       else {
-// this is tested on HP Longs Peak platform... it
-// will probably work on other Itanium platforms as
-// well, but undoubtedly needs work
-               longs_peak_putc(c);
-       }
-       return 1;
-}
-
diff --git a/xen/include/asm-x86/serial.h b/xen/include/asm-x86/serial.h
new file mode 100644 (file)
index 0000000..3ec4a2e
--- /dev/null
@@ -0,0 +1,22 @@
+/* -*-  Mode:C; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */
+/******************************************************************************
+ * asm-x86/serial.h
+ * 
+ * Architecture-specific private serial definitions.
+ */
+
+#ifndef __ASM_X86_SERIAL_H__
+#define __ASM_X86_SERIAL_H__
+
+#define OPT_COM1_STR ""
+#define OPT_COM2_STR ""
+
+static inline int arch_serial_putc(uart_t *uart, unsigned char c)
+{
+    int space;
+    if ( (space = (inb(uart->io_base + LSR) & LSR_THRE)) )
+        outb(c, uart->io_base + THR);
+    return space;
+}
+
+#endif /* __ASM_X86_SERIAL_H__ */
index 5c40db3e7d3dcc5e238621f48a566713fd78e92b..b5f5affdb2094ef1a88ce03547514e7dd05ddadd 100644 (file)
@@ -1,3 +1,4 @@
+/* -*-  Mode:C; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */
 /******************************************************************************
  * serial.h
  * 
@@ -5,7 +6,10 @@
  * it permits debugging of seriously-toasted machines (e.g., in situations
  * where a device driver within a guest OS would be inaccessible).
  * 
- * Copyright (c) 2003-2004, K A Fraser
+ * This file contains public definitions. The arch-specific header
+ * contains only private hooks, and is not included from this file.
+ * 
+ * Copyright (c) 2003-2005, K A Fraser
  */
 
 #ifndef __XEN_SERIAL_H__